package com.ruiysoft.entity.mdse;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 记录商品的库存和价格
 * </p>
 *
 * @author liyahui
 * @since 2018-12-01
 */
@TableName("merchandise_sku")
public class MerchandiseSku extends Model<MerchandiseSku> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "sku_id", type = IdType.AUTO)
    private Long skuId;

    @TableField("spu_id")
    private Long spuId;

    /**
     * sku型号
     */
    @TableField("sku_model")
    private String skuModel;

    @TableField("merchandise_name")
    private String merchandiseName;

    /**
     * 市场价
     */
    @TableField("list_price")
    private Long listPrice;

    /**
     * 成本价
     */
    @TableField("cost_price")
    private Long costPrice;

    /**
     * 销售价
     */
    @TableField("unit_price")
    private Long unitPrice;
    /**
     * 销量--用户自己定义
     */
    @TableField("salesVolume")
    private Long salesVolume;

    /**
     * 毛利率
     */
    @TableField("profit_margin")
    private BigDecimal profitMargin;

    private Integer quantity;

    /**
     * 访问次数
     */
    @TableField("visit_count")
    private Integer visitCount;

    /**
     * 是否可上架（0,是1，否)
     */
    @TableField("can_up")
    private Integer canUp;

    /**
     * 上下架状态(UP(1, "上架"), DOWN(2, "下架");)
     */
    private Integer status;

    /**
     * 分类ID
     */
    @TableField("main_category")
    private Long mainCategory;

    /**
     * 商户ID
     */
    @TableField("shop_id")
    private Long shopId;

    /**
     * 排序
     */
    @TableField("sort_index")
    private Integer sortIndex;

    /**
     * 物流模版ID
     */
    @TableField("freight_template_id")
    private String freightTemplateId;

    private Long creator;

    @TableField("create_time")
    private Date createTime;

    private Long updator;

    @TableField("update_time")
    private Date updateTime;

    private Integer version;

    @TableField("del_flag")
    private Integer delFlag;

    // 商品列表取的是最低价的sku；这里设置显示顺序
    Integer sequence;

    public Long getSkuId() {
        return skuId;
    }

    public MerchandiseSku setSkuId(Long skuId) {
        this.skuId = skuId;
        return this;
    }
    public Long getSpuId() {
        return spuId;
    }

    public MerchandiseSku setSpuId(Long spuId) {
        this.spuId = spuId;
        return this;
    }
    public String getSkuModel() {
        return skuModel;
    }

    public MerchandiseSku setSkuModel(String skuModel) {
        this.skuModel = skuModel;
        return this;
    }
    public String getMerchandiseName() {
        return merchandiseName;
    }

    public MerchandiseSku setMerchandiseName(String merchandiseName) {
        this.merchandiseName = merchandiseName;
        return this;
    }
    public Long getListPrice() {
        return listPrice;
    }

    public MerchandiseSku setListPrice(Long listPrice) {
        this.listPrice = listPrice;
        return this;
    }
    public Long getCostPrice() {
        return costPrice;
    }

    public MerchandiseSku setCostPrice(Long costPrice) {
        this.costPrice = costPrice;
        return this;
    }
    public Long getUnitPrice() {
        return unitPrice;
    }

    public MerchandiseSku setUnitPrice(Long unitPrice) {
        this.unitPrice = unitPrice;
        return this;
    }
    public BigDecimal getProfitMargin() {
        return profitMargin;
    }

    public MerchandiseSku setProfitMargin(BigDecimal profitMargin) {
        this.profitMargin = profitMargin;
        return this;
    }
    public Integer getQuantity() {
        return quantity;
    }

    public MerchandiseSku setQuantity(Integer quantity) {
        this.quantity = quantity;
        return this;
    }
    public Integer getVisitCount() {
        return visitCount;
    }

    public MerchandiseSku setVisitCount(Integer visitCount) {
        this.visitCount = visitCount;
        return this;
    }
    public Integer getCanUp() {
        return canUp;
    }

    public MerchandiseSku setCanUp(Integer canUp) {
        this.canUp = canUp;
        return this;
    }
    public Integer getStatus() {
        return status;
    }

    public MerchandiseSku setStatus(Integer status) {
        this.status = status;
        return this;
    }
    public Long getMainCategory() {
        return mainCategory;
    }

    public MerchandiseSku setMainCategory(Long mainCategory) {
        this.mainCategory = mainCategory;
        return this;
    }
    public Long getShopId() {
        return shopId;
    }

    public MerchandiseSku setShopId(Long shopId) {
        this.shopId = shopId;
        return this;
    }
    public Integer getSortIndex() {
        return sortIndex;
    }

    public MerchandiseSku setSortIndex(Integer sortIndex) {
        this.sortIndex = sortIndex;
        return this;
    }
    public String getFreightTemplateId() {
        return freightTemplateId;
    }

    public MerchandiseSku setFreightTemplateId(String freightTemplateId) {
        this.freightTemplateId = freightTemplateId;
        return this;
    }
    public Long getCreator() {
        return creator;
    }

    public MerchandiseSku setCreator(Long creator) {
        this.creator = creator;
        return this;
    }
    public Date getCreateTime() {
        return createTime;
    }

    public MerchandiseSku setCreateTime(Date createTime) {
        this.createTime = createTime;
        return this;
    }
    public Long getUpdator() {
        return updator;
    }

    public MerchandiseSku setUpdator(Long updator) {
        this.updator = updator;
        return this;
    }
    public Date getUpdateTime() {
        return updateTime;
    }

    public MerchandiseSku setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
        return this;
    }

    public Long getSalesVolume() {
        return salesVolume;
    }

    public void setSalesVolume(Long salesVolume) {
        this.salesVolume = salesVolume;
    }

    public Integer getVersion() {
        return version;
    }

    public MerchandiseSku setVersion(Integer version) {
        this.version = version;
        return this;
    }
    public Integer getDelFlag() {
        return delFlag;
    }

    public MerchandiseSku setDelFlag(Integer delFlag) {
        this.delFlag = delFlag;
        return this;
    }

    @Override
    protected Serializable pkVal() {
        return this.skuId;
    }

    @Override
    public String toString() {
        return "MerchandiseSku{" +
        "skuId=" + skuId +
        ", spuId=" + spuId +
        ", skuModel=" + skuModel +
        ", merchandiseName=" + merchandiseName +
        ", listPrice=" + listPrice +
        ", costPrice=" + costPrice +
        ", unitPrice=" + unitPrice +
        ", profitMargin=" + profitMargin +
        ", quantity=" + quantity +
        ", visitCount=" + visitCount +
        ", canUp=" + canUp +
        ", status=" + status +
        ", mainCategory=" + mainCategory +
        ", shopId=" + shopId +
        ", sortIndex=" + sortIndex +
        ", freightTemplateId=" + freightTemplateId +
        ", creator=" + creator +
        ", createTime=" + createTime +
        ", updator=" + updator +
        ", updateTime=" + updateTime +
        ", version=" + version +
        ", delFlag=" + delFlag +
        "}";
    }

    public Integer getSequence() {
        return sequence;
    }

    public void setSequence(Integer sequence) {
        this.sequence = sequence;
    }
}
